<!--{template common/header}-->
<!--{if $op == 'delete'}-->
<h3 class="flb">
	<em>{lang Into the trash}</em>
	<!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="hideWindow('$_G[gp_handlekey]');" class="flbc" title="{lang Close}">{lang Close}</a></span><!--{/if}-->
</h3>
<form method="post" autocomplete="off" action="index.php?option=portalcp&task=article&op=delete&aid=$_GET[aid]">
	<div class="c">
		<!--{if $_G['group']['allowarticlemod'] && $article['status'] == 1}-->
		{lang You sure you want to delete this post?}
		<input type="hidden" name="optype" value="0" class="pc" />
		<!--{else}-->
		<label><input type="radio" name="optype" value="0" class="pc" /> {lang Direct delete}</label>&nbsp;&nbsp;&nbsp;
		<label><input type="radio" name="optype" value="1" class="pc" checked="checked" /> {lang Into the trash}</label>
		<!--{/if}-->
	</div>
	<p class="o pns">
		<button type="submit" name="btnsubmit" value="true" class="pn pnc"><strong>{lang Confirms}</strong></button>
	</p>
	<input type="hidden" name="aid" value="$_GET[aid]" />
	<input type="hidden" name="referer" value="$_G[referer]" />
	<input type="hidden" name="deletesubmit" value="true" />
	<input type="hidden" name="formhash" value="{FORMHASH}" />
</form>
<!--{elseif $op == 'verify'}-->
<h3 class="flb">
	<em id="return_$_G[gp_handlekey]">{lang Audit New Posts}</em>
	<!--{if $_G[inajax]}--><span><a href="javascript:;" onclick="hideWindow('$_G[gp_handlekey]');" class="flbc" title="{lang Close}">{lang Close}</a></span><!--{/if}-->
</h3>
<form method="post" autocomplete="off" id="aritcle_verify_$aid" action="index.php?option=portalcp&task=article&op=verify&aid=$aid">
	<div class="c">
		<input type="radio" class="pr" name="status" value="0" id="status_0"{if $article[status]=='1'} checked{/if} /><label for="status_0">{lang Passed}</label>&nbsp;
		<input type="radio" class="pr" name="status" value="-1" id="status_x" /><label for="status_x">{lang Delete}</label>&nbsp;
		<input type="radio" class="pr" name="status" value="2" id="status_2"{if $article[status]=='2'} checked{/if} /><label for="status_2">{lang Ignore}</label>
	</div>
	<p class="o pns">
		<button type="submit" name="btnsubmit" value="true" class="pn pnc"><strong>{lang Confirms}</strong></button>
	</p>
	<input type="hidden" name="aid" value="$aid" />
	<input type="hidden" name="referer" value="$_G[referer]" />
	<input type="hidden" name="handlekey" value="$_G['gp_handlekey']" />
	<input type="hidden" name="verifysubmit" value="true" />
	<input type="hidden" name="formhash" value="{FORMHASH}" />
</form>
<!--{elseif $op == 'related'}-->

	<!--{if $ra}-->
	<li id="raid_li_$ra[aid]"><input type="hidden" name="raids[]" value="$ra[aid]" size="5">[ $ra[aid] ] <a href="index.php?task=view&aid=$ra[aid]" target="_blank">$ra[title]</a> <a href="javascript:;" onclick="raid_delete($ra[aid]);">{lang Delete}</a></li>
	<!--{/if}-->

<!--{else}-->

<div id="pt" class="bm cl">
	<div class="z">
		<a href="./" class="nvhm" title="{lang Homepage}">$_G[setting][sitename]</a> <em>&rsaquo;</em>
		<a href="$_G[setting][navs][1][filename]">$_G[setting][navs][1][navname]</a> <em>&rsaquo;</em>

		<a href="index.php?option=portalcp">{lang Portal management}</a> <em>&rsaquo;</em>
		
		<!--{if $cate}-->
		<a href="index.php?option=portalcp&task=category&catid=$cate[catid]">$cate[catname]</a> <em>&rsaquo;</em>
		<!--{/if}-->
		<!--{if !empty($aid)}-->
		<a href="index.php?option=portalcp&task=article&aid=$article[aid]">{lang Edit}</a>
		<!--{else}-->
		<a href="index.php?option=portalcp&task=article&catid=$catid">{lang Article publish}</a>
		<!--{/if}-->
	</div>
</div>
<script language="javascript">
	function showdivcustomfieldtext() {
		var cfindex = $$$("customfieldid").selectedIndex;
		showtbody(cfindex);
	}	
	function showtbody(id) {
		for(i=1;i<=$tbodynum;i++){
			obj=$("cf_"+i);
			if(i == id) {
				obj.style.display="";
			} else {
				obj.style.display="none";
			}
		}
	}
	function adddivcustomfield(id, str) {
		var oDiv=document.createElement("div");
		document.getElementById(id).appendChild(oDiv);
		oDiv.innerHTML = str;
	}
</script>
<div id="ja-content-main" class="ja-content-main clearfix">
<div id="ct" class="ct2_a wp cl">
	<div class="mn" style="float: left;">
		<div class="bm bw0">
			<h1 class="mt"><!--{if !empty($aid)}-->{lang Edit}<!--{else}-->{lang Article publish}<!--{/if}--></h1>
			<script type="text/javascript" src="{$_G[siteurl]}static/js/calendar.js"></script>
			<form method="post" autocomplete="off" id="articleform" action="index.php?option=portalcp&task=article{if $_G[gp_modarticlekey]}&modarticlekey=$_G[gp_modarticlekey]{/if}" enctype="multipart/form-data">
				<div class="left" style="width: 104px; text-align: right; padding: 4px 4px;">
					{lang Title}
				</div>
				<div class="pbn left">
					<input type="text" class="px p_fre" id="title" name="title" value="$article[title]" size="80" />
				</div>
				<div class="exfm pns cl clearfix">
					<div class="sinf z">
						<!--{if empty($article['aid']) || empty($article['catid'])}-->
						<dl>
							<dt>{lang Category}</dt>
							<dd>
								<span class="ftid">
									<select name="catid" id="catid" class="ps">
										<option value="0">{lang Pls select category}</option>
										<!--{loop $allcategory $cat}-->
										<option value="{$cat[catid]}" <!--{if $catid==$cat[catid]}-->selected<!--{/if}-->>$cat[catname]</option>
										<!--{/loop}-->
									</select>
								</span>
								<script type="text/javascript">simulateSelect('catid', 216);</script>
							</dd>
						</dl>
						<!--{/if}-->
						<dl>
							<dt>{lang Article url}</dt>
							<dd><input type="text" class="px p_fre" name="url" value="$article[url]" size="30" /></dd>
						</dl>
						<dl>
							<dt>{lang Article author}</dt>
							<dd><input type="text" name="author" class="px p_fre" value="$article[author]" size="30" /></dd>
						</dl>

					</div>
					<div class="sadd z">
						<dl>
							<dt>{lang Article source}</dt>
							<dd><input type="text" name="from" class="px p_fre" value="$article[from]" size="30" /></dd>
						</dl>
						<dl>
							<dt>{lang Article source url}</dt>
							<dd><input type="text" name="fromurl" class="px p_fre" value="$article[fromurl]" size="30" /></dd>
						</dl>
						<div><input type="hidden" id="conver" name="conver" value="" /></div>
					</div>
				</div>
				<!--{if $article['aid']}-->
				<div class="pgm clearfix" style="margin-bottom: 4px;">
					<div class="pg left">
					<strong>{lang Save to}</strong>{$pageselect}
					<a href="index.php?option=portalcp&task=article&op=addpage&aid=$aid" style="float: right;">{lang Add a new page}</a>
					<!--{if $article_content}-->
						<a href="index.php?option=portalcp&task=article&op=delpage&aid=$aid&cid=$article_content[cid]" style="float: right;">{lang Delete this page}</a>
					<!--{else}-->
						<a href="javascript:history.back();" style="float: right;">{lang Delete this page}</a>
					<!--{/if}-->
					</div>
					$multi
				</div>
				<!--{/if}-->

				<script language="javascript" src="{STATICURL}image/editor/editor_function.js"></script>
				<textarea class="userData" name="content" id="jycms-ttHtmlEditor" style="height: 100%; width: 100%; display: none; border: 0px">$article_content[content]</textarea>
				<iframe src="index.php?option=misc&task=editor&charset={CHARSET}&allowhtml=1&isportal=1" name="jycms-ifrHtmlEditor" id="jycms-ifrHtmlEditor" scrolling="no" border="0" frameborder="0" style="width:718px;height:400px;border: 1px solid #C5C5C5;"></iframe>

				<div class="bm bml">
					<div class="bm_h cl">
						<h2>{lang Summary}</h2>
					</div>
					<div class="bm_c"><textarea name="summary" cols="80" class="pt" style="width: 700px; w\idth: 700px;">$article[summary]</textarea></div>
				</div>
				<!--{if $page<2 && $op != 'addpage'}-->
				{if $customfields}
				<div class="bm bml">
					<div class="bm_h cl">
						<h2 style="width: auto; float: left;">{lang Customfields}</h2>
						<div class="left">
							<select id="customfieldid" name="customfieldid" onchange="showdivcustomfieldtext()">
							<option value="0" {if $article[customfieldid]==0}selected{/if}>{lang Not use}</option>
							{loop $customfields $v}
							<option value="{$v[customfieldid]}" {if $article[customfieldid]==$v[customfieldid]}selected{/if}>$v[name]</option>
							{/loop}
							</select>
						</div>
					</div>
					<div class="exfm clearfix">
						{$cfhtml}
					</div>
				</div>
{/if}
				<div class="exfm clearfix">
					<h2>{lang Related article} <a id="related_article" href="index.php?option=portalcp&task=related&catid=$catid&aid=$aid" class="xi2" style="text-decoration: underline;" onclick="showWindow(this.id, this.href, 'get', 0)">{lang Select}</a></h2>
					<ul id="raid_div" class="xl">
						<!--{if $article[related]}-->
							<!--{loop $article[related] $ra}-->
								<li id="raid_li_$ra[aid]"><input type="hidden" name="raids[]" value="$ra[aid]" size="5"><a href="index.php?task=view&aid=$ra[aid]" target="_blank">$ra[title]</a> ({lang Article} ID: $ra[aid]) <a href="javascript:;" onclick="raid_delete($ra[aid]);" class="xg1">{lang Delete}</a></li>
							<!--{/loop}-->
						<!--{/if}-->
					</ul>
				</div>
				<!--{/if}-->

				<div class="ptm pbm">
					<button type="button" id="issuance" class="pn pnc" name="articlebutton" onclick="validatef(this);"><strong>{lang Submit}</strong></button>
					<label><input type="checkbox" name="addpage" value="1" class="pc"> {lang Save and then continue to add new page}</label>
					<!--{if $cate[allowcomment]}--><span class="pipe">|</span><label for="ck_allowcomment"><input type="checkbox" name="forbidcomment" id="ck_allowcomment" class="pc" value="1"{if isset($article['allowcomment']) && empty($article['allowcomment'])}checked="checked"{/if} /> {lang Prohibit comment on this article}</label><!--{/if}-->
				</div>

				<input type="hidden" id="aid" name="aid" value="$article[aid]" />
				<input type="hidden" name="cid" value="$article_content[cid]" />
				<input type="hidden" id="attach_ids" name="attach_ids" value="0" />
				<input type="hidden" name="articlesubmit" value="true" />
				<!--{if $op=='edit'||$op=='addpage'}-->
				<input type="hidden" name="catid" value="$catid" />
				<!--{/if}-->
				<input type="hidden" name="formhash" value="{FORMHASH}" />
			</form>
		</div>
	</div>
	<div class="appl" style="float: right;padding:0; margin: 0; width: 240px;border: none; background-color: transparent;">
		<h3 class="mbm pbm bbs">{lang Upload attachment}</h3>
		<div class="pbm xg1">{lang Upload pictures for the current article, file attachments resources. <br> After uploading, you need to insert it into the article content can be displayed.}</div>
		<div id="attachbodyhidden" style="display:none;">
			<form method="post" autocomplete="off" id="upload" action="index.php?option=portalcp&task=upload&aid=$aid" enctype="multipart/form-data" target="uploadframe" style="background: transparent;">
				<input type="file" name="attach" class="pf" size="8" />
				<span id="localfile"></span>
				<input type="hidden" name="uploadsubmit" id="uploadsubmit" value="true" />
				<input type="hidden" name="formhash" value="{FORMHASH}" />
			</form>
		</div>
		<div id="attachbody" class="bn"></div>

		<script src="{$_G[siteurl]}static/js/portal_upload.js" type="text/javascript"></script>
		<iframe id="uploadframe" name="uploadframe" width="0" height="0" marginwidth="0" frameborder="0" src="about:blank"></iframe>

		<div id="attach_image_body" class="bn">$article[attach_image]</div>
		<div id="attach_file_body" class="bn">$article[attach_file]</div>

	</div>
</div>
</div>
<script type="text/javascript">
function from_get() {
	var el = $$$('catid');
	var catid = el ? el.value : 0;
	window.location.href='index.php?option=portalcp&task=article&from_idtype='+$$$('from_idtype').value+'&catid='+catid+'&from_id='+$$$('from_id').value;
	return true;
}
function validatef(obj) {
	var catid = $$$('catid');
	if(catid==0){
			alert("{lang Please select the System category!}");
			catid.focus();
			return false;
	}
	var title = $$$('title');
	if(title) {
		var slen = strlen(title.value);
		if (slen < 1 || slen > 80) {
			alert("{lang Title Length (1 ~ 80 characters) does not meet the requirements!}");
			title.focus();
			return false;
		}
	}
	var catObj = $$$("catid");
	if(catObj) {
		if (catObj.value < 1) {
			alert("{lang Please select the System category!}");
			catObj.focus();
			return false;
		}
	}
	edit_save();
	obj.form.submit();
	return false;
}
function raid_add() {
	var raid = $$$('raid').value;
	if($$$('raid_li_'+raid)) {
		alert('{lang This article has exists}');
		return false;
	}
	var url = 'index.php?option=portalcp&task=article&op=related&inajax=1&aid={$article[aid]}&raid='+raid;
	var x = new Ajax();
	x.get(url, function(s){
		s = trim(s);
		if(s) {
			$$$('raid_div').innerHTML += s;
		} else {
			alert('{lang Did not find the specified article}');
			return false;
		}
	});
}
function raid_delete(aid) {
	var node = $$$('raid_li_'+aid);
	var p;
	if(p = node.parentNode) {
		p.removeChild(node);
	}   
}
if($$$('title')) {
	$$$('title').focus();
}
</script>

<!--{/if}-->

<!--{template common/footer}-->